from django.http import HttpResponse
from django.shortcuts import render


# 视图函数
def index(request):
    print('给我一个首页。。。')
    # 返回响应结果
    # return HttpResponse('首页‘）
    # 字典类型
    context = {
        'name': '张三',
        'sex': '男'
    }
    return  render(request, 'index.html', context)

from django.views import  View


class RegisterView(View):
    def get(self, request):
        return render(request, 'register.html')

    def post(self, request):
        return HttpResponse('注册成功')

    def delete(self, request):
        return HttpResponse('删除成功')
    def put(self, request):
        return HttpResponse('修改成功')